|
btez2 2.2.0
|
API for configuring and manipulating BT-EZ 2 Click driver. More...
Topics | |
| BT-EZ 2 Device Settings | |
| Settings for registers of BT-EZ 2 Click driver. | |
| BT-EZ 2 MikroBUS Map | |
| MikroBUS pin mapping of BT-EZ 2 Click driver. | |
Functions | |
| void | btez2_cfg_setup (btez2_cfg_t *cfg) |
| BT-EZ 2 configuration object setup function. | |
| err_t | btez2_init (btez2_t *ctx, btez2_cfg_t *cfg) |
| BT-EZ 2 initialization function. | |
| err_t | btez2_generic_write (btez2_t *ctx, uint8_t *data_in, uint16_t len) |
| BT-EZ 2 data writing function. | |
| err_t | btez2_generic_read (btez2_t *ctx, uint8_t *data_out, uint16_t len) |
| BT-EZ 2 data reading function. | |
| void | btez2_set_rst_pin (btez2_t *ctx, uint8_t state) |
| BT-EZ 2 set RST pin function. | |
| void | btez2_reset_device (btez2_t *ctx) |
| BT-EZ 2 reset device function. | |
| void | btez2_set_cts_pin (btez2_t *ctx, uint8_t state) |
| BT-EZ 2 set CTS pin function. | |
| uint8_t | btez2_get_rts_pin (btez2_t *ctx) |
| BT-EZ 2 get RTS pin function. | |
| void | btez2_set_cmd_mode (btez2_t *ctx) |
| BT-EZ 2 set cmd mode function. | |
| void | btez2_set_data_mode (btez2_t *ctx) |
| BT-EZ 2 set data mode function. | |
| void | btez2_cmd_action (btez2_t *ctx, uint8_t *cmd, uint8_t *params) |
| BT-EZ 2 cmd action function. | |
| void | btez2_cmd_set (btez2_t *ctx, uint8_t *cmd, uint8_t *params) |
| BT-EZ 2 cmd set function. | |
| void | btez2_cmd_get (btez2_t *ctx, uint8_t *cmd, uint8_t *params) |
| BT-EZ 2 cmd get function. | |
| void | btez2_cmd_profile (btez2_t *ctx, uint8_t *cmd, uint8_t *params) |
| BT-EZ 2 cmd profile function. | |
| err_t | btez2_read_packet (btez2_t *ctx) |
| BT-EZ 2 read packet function. | |
API for configuring and manipulating BT-EZ 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void btez2_cfg_setup | ( | btez2_cfg_t * | cfg | ) |
BT-EZ 2 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See btez2_cfg_t object definition for detailed explanation. |
| void btez2_cmd_action | ( | btez2_t * | ctx, |
| uint8_t * | cmd, | ||
| uint8_t * | params ) |
BT-EZ 2 cmd action function.
This function sends a specified action command to the Click module.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [in] | cmd | : Command string, see BTEZ2_CMD_x action definitions. |
| [in] | params | : Command arguments string (optional). |
| void btez2_cmd_get | ( | btez2_t * | ctx, |
| uint8_t * | cmd, | ||
| uint8_t * | params ) |
BT-EZ 2 cmd get function.
This function sends a specified get command to the Click module.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [in] | cmd | : Command string, see BTEZ2_CMD_x set/get definitions. |
| [in] | params | : Command arguments string (optional). |
| void btez2_cmd_profile | ( | btez2_t * | ctx, |
| uint8_t * | cmd, | ||
| uint8_t * | params ) |
BT-EZ 2 cmd profile function.
This function sends a specified profile command to the Click module.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [in] | cmd | : Command string, see BTEZ2_CMD_x profile definitions. |
| [in] | params | : Command arguments string (optional). |
| void btez2_cmd_set | ( | btez2_t * | ctx, |
| uint8_t * | cmd, | ||
| uint8_t * | params ) |
BT-EZ 2 cmd set function.
This function sends a specified set command to the Click module.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [in] | cmd | : Command string, see BTEZ2_CMD_x set/get definitions. |
| [in] | params | : Command arguments string. |
| err_t btez2_generic_read | ( | btez2_t * | ctx, |
| uint8_t * | data_out, | ||
| uint16_t | len ) |
BT-EZ 2 data reading function.
This function reads a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
>0 - Number of data bytes read, <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation. | err_t btez2_generic_write | ( | btez2_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | len ) |
BT-EZ 2 data writing function.
This function writes a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [in] | data_in | : Data buffer for sending. |
| [in] | len | : Number of bytes for sending. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | uint8_t btez2_get_rts_pin | ( | btez2_t * | ctx | ) |
BT-EZ 2 get RTS pin function.
This function returns the request to send pin logic state.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| err_t btez2_init | ( | btez2_t * | ctx, |
| btez2_cfg_t * | cfg ) |
BT-EZ 2 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See btez2_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t btez2_read_packet | ( | btez2_t * | ctx | ) |
BT-EZ 2 read packet function.
This function reads a response or event packet from the Click module and stores it in ctx->evt_pkt structure.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void btez2_reset_device | ( | btez2_t * | ctx | ) |
BT-EZ 2 reset device function.
This function resets the device by toggling the reset pin logic state.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| void btez2_set_cmd_mode | ( | btez2_t * | ctx | ) |
BT-EZ 2 set cmd mode function.
This function sets the command mode by setting the CYSPP pin to high logic state.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| void btez2_set_cts_pin | ( | btez2_t * | ctx, |
| uint8_t | state ) |
BT-EZ 2 set CTS pin function.
This function sets the clear to send pin logic state.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| void btez2_set_data_mode | ( | btez2_t * | ctx | ) |
BT-EZ 2 set data mode function.
This function sets the data mode by setting the CYSPP pin to low logic state.
| [in] | ctx | : Click context object. See btez2_t object definition for detailed explanation. |